<style type="text/css">
    .percent-list {
        margin: 5px auto;
    }
</style>
<form action="" class="form-horizontal" role="form">

    <div class="form-group">
        <label class="col-sm-2 control-label">商城名称</label>
        <div class="col-sm-3">
            <input type="text" class="form-control" name="name" placeholder="请输入商城名称" datatype="*" value="{$mall.name}" />
        </div>
    </div>
    <div class="form-group">
        <label class="col-sm-2 control-label">负责人电话</label>
        <div class="col-sm-3">
            <input type="text" class="form-control" name="tel" placeholder="请输入联系电话" datatype="*" value="{$mall.tel}" />
        </div>
    </div>
    <div class="form-group">
        <label class="col-sm-2 control-label">关注链接</label>
        <div class="col-sm-3">
            <input type="text" class="form-control" name="subscribe_url" placeholder="请输入关注链接" value="{$mall.subscribe_url}" />
        </div>
    </div>
    <div class="form-group">
        <label class="col-sm-2 control-label">试用产品如何参加链接</label>
        <div class="col-sm-3">
            <input type="text" class="form-control" name="try_url" placeholder="请输入试用产品如何参加链接" value="{$mall.try_url}" />
        </div>
    </div>
    <div class="form-group">
        <label class="col-sm-2 control-label">网站Logo</label>
        <div class="col-sm-6">
            <div class="image-result-content">
                <img id="image-result" class="margin-bottom" src="{$mall.logo}" style="width: 100px;" />
            </div>
            <input type="text" id="logo" name="logo" class="form-control margin-bottom" value="{$mall.logo}" />
            <input type="file" name="file_upload" id="image_upload" />
        </div>
    </div>
    <div class="form-group">
        <label class="col-sm-2 control-label">网站描述</label>
        <div class="col-sm-3">
            <textarea name="description" class="form-control">{$mall.description}</textarea>
        </div>
    </div>
    
    <div class="form-group">
        <label class="col-sm-2 control-label">未关注提示内容</label>
        <div class="col-sm-3">
            <textarea name="unsubscribe_text" class="form-control">{$mall.unsubscribe_text}</textarea>
        </div>
    </div>
    
    <div class="form-group">
        <label class="col-sm-2 control-label">已关注提示内容</label>
        <div class="col-sm-3">
            <textarea name="subscribed_text" class="form-control">{$mall.subscribed_text}</textarea>
        </div>
    </div>

    <div class="form-group">
        <label class="col-sm-2 control-label">客服电话</label>
        <div class="col-sm-3">
            <input type="text" class="form-control" name="service_tel" placeholder="请输入客服电话" value="{$mall.service_tel}" />
        </div>
    </div>

    <div class="form-group">
        <label class="col-sm-2 control-label">版权声明</label>
        <div class="col-sm-3">
            <input type="text" class="form-control" name="copyright" value="{$mall.copyright}" />
        </div>
    </div>

    <div class="form-group">
        <label class="col-sm-2 control-label">状态</label>
        <div class="col-sm-3">{$mall.status}</div>
    </div>

    <div class="form-group">
        <div class="col-sm-offset-2 col-sm-8">
            <input type="hidden" name="id" value="{$mall.id}" /> <a class="btn btn-default" onclick="javascript:history.go(-1)">返回上页</a>
            <a class="btn btn-default" onclick="self.location=document.referrer">返回上页并刷新</a>
            <button type="submit" class="btn btn-primary submit" data-loading-txt="提交中，请稍后……" data-ajax-url="__CONTROLLER__/save">保存更改</button>
        </div>
    </div>
</form>

<!-- uploadify -->
<link rel="stylesheet" href="__PUBLIC__/Style/Common/uploadify/uploadify.css">
<script type="text/javascript" src="__PUBLIC__/Style/Common/uploadify/jquery.uploadify.min.js?{:rand(0,9999)}"></script>
<script type="text/javascript">
    $("#image_upload").uploadify({
        'multi': true,
        'buttonClass': 'margin-bottom',
        'fileSizeLimit': '200kb',
        'buttonText': '上传图片',
        'fileTypeDesc': 'Image Files',
        'fileTypeExts': '*.jpg; *.png',
        'swf': '__PUBLIC__/Style/Common/uploadify/uploadify.swf',
        'uploader': '__MODULE__/Upload/uploadOne',
        'onUploadStart': function() {},
        'onUploadSuccess': function(data, res) {
            var url = eval("(" + res + ")").extra.url;
            $("#logo").val(url);
        }
    });

    //经过图片路径文本框时显示预览图片
    var img = $("<img>");
    $("#logo").on("mouseover", function(e) {
        $(this).parent().css({
            "position": "relative"
        });
        $(img).attr("src", $(this).val());
        $(img).css({
            "position": "absolute",
            "top": 0,
            "left": "100%",
            "maxWidth": "200px"
        });
        $(img).appendTo($(this).parent());
    });
    $("#logo").on("mouseout", function(e) {
        $(img).remove();
    });
</script>